<template>
	<view class="flex-col page">
		<view class="flex-col group">
			<view class="flex-col">
				<text class="text_1">我的需求</text>
				<view class="items-start u-m-t-30" style="width: 92vw;">
					<!-- <textarea style="width:100%" v-model="hint" auto-height placeholder="请输入需求" auto-focus /> -->
					<u--textarea height="460" confirmType="done" v-model="hint" placeholder="请输入需求" auto-focus></u--textarea>

				</view>
			</view>

		</view>
		<view class="flex-col items-center button " @click="submit"><text class="text_3">保存</text></view>
	</view>
</template>

<script>
	export default {
		components: {},

		data() {
			return {
				hint: ''
			};
		},
		onShow() {
			this.getHint();
		},
		methods: {
			getHint()
			{
			  this.$http('lservice.hint').then(r=>{
				  if(r.code==200)
				  {
					  this.hint=r.data
					
				  }
			  });	
			},
			submit() {
				if (!this.hint) {
					this.$u.toast('请输入需求');
					return;
				}
				
				this.$http('check.editHintByToken', {
					hint: this.hint
				}).then(r => {
					if (r.code == 200) {
						// uni.navigateBack(
						// {
						// 	delta:1
						// }
						// )
						let  pageNum = 2
														let pages = getCurrentPages(); // 当前页面
														let beforePage = pages[pages.length - pageNum]; // 前一个页面
													 console.log(beforePage);
														uni.navigateBack({
														    success: function() {
														        beforePage.$vm.$refs.protab.init(); 
														    }
														
						  }
						);
					}
				});
				
			}
		},
	};
</script>

<style scoped lang="scss">
	.page {
		background-color: #ffffffff;
		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		height: 100%;
	}

	.group {
		padding: 37rpx 31rpx 48rpx;
		flex: 1 1 auto;
		overflow-y: auto;
	}

	.button {
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		margin-top: 499rpx;
		margin-left: 32rpx;
		margin-right: 32rpx;
		height: 88rpx;
		background-color: #1d6aff;
		border-radius: 44rpx;
	}

	.text_1 {
		align-self: flex-start;
		color: #191919;
		font-weight: 600;
		font-size: 32rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 38rpx;
	}

	.text-wrapper {
		margin-top: 35rpx;
		padding: 31rpx 0 398rpx;
		border-radius: 16rpx;
		background-image: url('https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/617a2ca7e4f1450011362b37/62b14c62d02982001153329a/16557868010777354971.png');
		background-size: 100% 100%;
		background-repeat: no-repeat;
	}

	.text_3 {
		color: #ffffff;
		font-size: 32rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 38rpx;
	}

	.text_2 {
		margin-left: 25rpx;
		color: #999999;
		font-size: 28rpx;
		font-family: '.AppleSystemUIFont';
		line-height: 33rpx;
	}
</style>
